package com.chixing.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chixing.entity.Myorder;
import com.chixing.service.IMyorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Yebken.
 * @since 2025-06-25
 */
@RestController
@RequestMapping("/myorder")
public class MyorderController {

    @Autowired
    private IMyorderService myorderService;

    @GetMapping("page/{pageNum}")
    public Page getAllByCustomerId(@PathVariable("pageNum") Integer pageNum){
        if(pageNum == null)
            pageNum = 1;
       return myorderService.getAll(pageNum,1);
    }

}
